#!/usr/bin/python

#display.py - display abstraction

from WinDisplay import *
from CursesDisplay import *

class Display:
	def __init__(self, type):
		if(type == "win"):
			self._display = WinDisplay()
		elif(type == "curses"):
			self._display = CursesDisplay()
		
	def write_string(self, x, y, str):
		self._display.write_string(x, y, str)
	
	def write_char(self, x, y, char):
		self._display.write_char(x, y, char)
		
	def killme(self):
		self._display.killme()
		
	def getstr(self):
		return self._display.getstr()
	
	def getch(self):
		return self._display.getch()

	def refresh(self):
		self._display.refresh()
		
if(__name__ == '__main__'):
	disp = Display('curses')
	disp.write_string(0,0,"Test 0,0")
	disp.write_string(3,4,"Test 3,4")
	disp.write_char(79,24,'C')
	disp.refresh()
	
	disp.write_char(5,5,disp.getch())
	disp.refresh()
	disp.write_string(0,1, "Press enter.")
	disp.refresh()
	disp.getstr()
	
	disp.killme()
	
	
